package {{ current_package }}.{{ module }}.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * {{ table_comment }} Entity
 *
 * @author {{ author }}
 * @date {{ create_date }}
 */
@Data
@Accessors(chain = true)
@TableName("{{ table.table_name }}")
public class {{ table_name | upper_camel }}Entity implements Serializable {

    private static final long serialVersionUID = 1L;
{% for field in table.fields %}
    /**
     * {{ field.column_comment }}
     */
 {% if field.column_key == "PRI" %}   @TableId(value = "{{ field.column_name }}", type = IdType.ASSIGN_ID){% else %}   @TableField("{{ field.column_name }}"){% endif %}
    private {% if field.data_type == "bigint" %}Long{% elif field.data_type == "int" %}Integer{% elif field.data_type == "int" %}Integer{% elif field.data_type == "tinyint" %}Integer{% elif field.data_type == "datetime" %}LocalDateTime{% elif field.data_type == "varchar" or field.data_type == "text" or field.data_type == "mediumtext" or field.data_type == "longtext" %}String{% elif field.data_type == "double" %}Double{% endif %} {{ field.column_name | lower_camel }};
{% endfor %}
}

